import request from '@/request/request'

// 分页查询零售退货单
export function getRetailReturnPage(params) {
    return request({
        method: "get",
        url: "/retail/return/page",
        params
    })
}

// 创建零售退货单
export function createRetailReturn(data) {
    return request({
        method: "post",
        url: "/retail/return",
        data
    })
}

// 更新零售退货单
export function updateRetailReturn(data) {
    return request({
        method: "put",
        url: "/retail/return",
        data
    })
}

// 删除零售退货单
export function deleteRetailReturn(id) {
    return request({
        method: "delete",
        url: `/retail/return/${id}`,
    })
}

// 完成零售退货单
export function completeRetailReturn(id) {
    return request({
        method: "put",
        url: `/retail/return/complete/${id}`,
    })
}

// 获取零售退货单详情（包含明细）
export function getRetailReturnWithDetails(id) {
    return request({
        method: "get",
        url: `/retail/return/withDetails/${id}`,
    })
}
